home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
COMAL
/
A-COMAL Series
/
(k)aad.d64
/
func.decimal
< prev
next >
Wrap
Text File
|
2007-02-28
|
344b
|
13 lines
0010 //
0020 FUNC DECIMAL(NUMBER$,BASE) CLOSED
0030 DIM N$ OF 36
0040 N$:="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
0050 L'N:=LEN(NUMBER$)
0060 IF L'N=1 THEN
0070 RETURN (NUMBER$ IN N$)-1
0080 ELSE
0090 REST:=DECIMAL(NUMBER$(1:L'N-1),BASE)*BASE
0100 RETURN REST+DECIMAL(NUMBER$(L'N),BASE)
0110 ENDIF
0120 ENDFUNC DECIMAL